<template>
    <div class="flow-node branch">
        <div class="nodes">
            <FlowNode
                v-if="config.type == 'start' || config.type == 'approval' || config.type == 'end' || config.type == 'cc' || config.type == 'handle' || config.type == 'condition'"
                :config="config" />

        </div>
    </div>
</template>
<script>
import FlowNode from './FlowNode.vue'
export default {
    props:{
        config:{
            type:Object,
            default:()=>{
                return {
                    
                }
            }
        }
    },
    components: {
        FlowNode
    },
    data() {
        return {
            flows: [{ "name": "提交", "type": "start", "approvalAttrubuteData": { "approvalName": "提交", placeholder: "请选择器提交人" } }, { "name": "顶头上司审批", "type": "approval", "approvalAttrubuteData": { "approvalName": "顶头上司审批", "flowType": "approval", "approvalMethod": "人工审批", "placeholder": "提交人：请选择审批人", "approvalTargets": [{ "target": "指定成员", "users": ["王鹤棣"] }], "approverNoExistWhen": { "action": "自动通过" }, "approverPresentWhen": { "action": "自动跳过" }, "approverMultipleWhen": { "action": "或签（一名审批人同意即可）" }, "ccTargets": [{ "target": "指定成员", "users": [""] }] } }, { "name": null, "type": "branch", "approvalAttrubuteData": null, "branch": [[{ "name": "半导体", "type": "condition", "approvalAttrubuteData": { "approvalName": "半导体", "flowType": "condition", "placeholder": "请设置条件", "conditionGroups": [{ "name": "条件1", "conditions": [{ "field": "收款发生日期", "expression": "等于", "target": "审批提交时间" }, { "field": "收款发生日期", "expression": "等于", "target": "审批提交时间" }, { "field": "收款类别", "expression": "早于", "target": "审批提交时间" }] }, { "name": "条件2", "conditions": [{ "field": "收款发生日期", "expression": "等于", "target": "审批提交时间" }, { "field": "提交人", "expression": "晚于", "target": "审批提交时间" }] }] }, "isDefault": false }, { "name": "组长审批", "type": "approval", "approvalAttrubuteData": { "approvalName": "组长审批", "flowType": "approval", "approvalMethod": "人工审批", "placeholder": "提交人：请选择审批人", "approvalTargets": [{ "target": "指定成员", "users": ["小李"] }], "approverNoExistWhen": { "action": "自动通过" }, "approverPresentWhen": { "action": "自动跳过" }, "approverMultipleWhen": { "action": "会签" }, "ccTargets": [] } }], [{ "name": "条件分支", "type": "condition", "approvalAttrubuteData": { "approvalName": "条件分支", "flowType": "condition", "placeholder": "请设置条件", "conditionGroups": [{ "name": "条件1", "conditions": [{ "field": "姓名", "expression": "等于", "target": "李飞飞" }, { "field": "姓名", "expression": "等于", "target": "李飞飞" }] }] }, "isDefault": true }, { "name": "机电组长", "type": "approval", "approvalAttrubuteData": { "approvalName": "机电组长", "flowType": "approval", "approvalMethod": "人工审批", "placeholder": "提交人：请选择审批人", "approvalTargets": [{ "target": "指定成员", "users": ["张飒"] }], "approverNoExistWhen": { "action": "自动通过" }, "approverPresentWhen": { "action": "自动跳过" }, "approverMultipleWhen": { "action": "会签" }, "ccTargets": [] } }], [{ "name": "机电", "type": "condition", "approvalAttrubuteData": { "approvalName": "机电", "flowType": "condition", "placeholder": "请设置条件", "conditionGroups": [{ "name": "条件1", "conditions": [{ "field": "收款发生日期", "expression": "等于", "target": "审批提交时间" }, { "field": "收款发生日期", "expression": "等于", "target": "审批提交时间" }] }] }, "isDefault": false }, { "name": "审批3", "type": "approval", "approvalAttrubuteData": { "approvalName": "审批3", "flowType": "approval", "approvalMethod": "人工审批", "placeholder": "提交人：请选择审批人", "approvalTargets": [{ "target": "指定成员", "users": ["刘宪华"] }], "approverNoExistWhen": { "action": "自动通过" }, "approverPresentWhen": { "action": "自动跳过" }, "approverMultipleWhen": { "action": "会签" }, "ccTargets": [] } }]] }, { "name": "后勤指挥部审批", "type": "approval", "approvalAttrubuteData": { "approvalName": "后勤指挥部审批", "flowType": "approval", "approvalMethod": "人工审批", "placeholder": "提交人：请选择审批人", "approvalTargets": [{ "target": "指定成员", "users": ["刘不占"] }], "approverNoExistWhen": { "action": "自动通过" }, "approverPresentWhen": { "action": "自动跳过" }, "approverMultipleWhen": { "action": "会签" }, "ccTargets": [] } }, { "name": "结束", "type": "end", "approvalAttrubuteData": { "approvalName": "结束", "flowType": "end", "placeholder": "流程结束", "ccTargets": [{ "target": "指定成员", "users": [] }] } }]
        }
    }
}
</script>